package com.ljf.tijian.service;

import com.ljf.tijian.dto.ApiResponse;
import com.ljf.tijian.mapper.OverallresultMapper;
import com.ljf.tijian.pojo.Overallresult;
import com.ljf.tijian.service.Impl.OverallResultServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OverallResultService implements OverallResultServiceImpl {

    @Autowired
    OverallresultMapper overallresultMapper;

    @Override
    public ApiResponse getOverallResultData(Integer orderId) {
        List<Overallresult> overallresults = overallresultMapper.selectByOrderId(orderId);
        return new ApiResponse(200,"SUCCESS",overallresults);
    }

    @Override
    public ApiResponse updateOverallResultData(Overallresult overallresult) {
        overallresultMapper.updateByPrimaryKeySelective(overallresult);
        return new ApiResponse(200,"SUCCESS");
    }

    @Override
    public ApiResponse deleteOverallResultData(Integer orId) {
        overallresultMapper.deleteByPrimaryKey(orId);
        return new ApiResponse(200,"SUCCESS");
    }

    @Override
    public ApiResponse addOverallResultData(Overallresult overallresult) {
        overallresultMapper.insertSelective(overallresult);
        return new ApiResponse(200,"SUCCESS");
    }


}
